import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_text_reader/flutter_text_reader.dart';
import 'package:flutter_text_reader/flutter_text_reader_platform_interface.dart';
import 'package:flutter_text_reader/flutter_text_reader_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterTextReaderPlatform
    with MockPlatformInterfaceMixin
    implements FlutterTextReaderPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterTextReaderPlatform initialPlatform = FlutterTextReaderPlatform.instance;

  test('$MethodChannelFlutterTextReader is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterTextReader>());
  });

  test('getPlatformVersion', () async {
    FlutterTextReader flutterTextReaderPlugin = FlutterTextReader();
    MockFlutterTextReaderPlatform fakePlatform = MockFlutterTextReaderPlatform();
    FlutterTextReaderPlatform.instance = fakePlatform;

    expect(await flutterTextReaderPlugin.getPlatformVersion(), '42');
  });
}
